import http from './http'

// ===== Operation Logs APIs =====
// Page query: GET /intelligent-set/logs/list
// params: { current, size, keyword }
export function pageOperationLogs(params) {
  return http.get('/intelligent-set/logs/list', { params })
}

// Delete operation log: DELETE /intelligent-set/logs/{id}
export function deleteOperationLog(id) {
  return http.delete(`/intelligent-set/logs/${id}`)
}

// Batch delete operation logs: DELETE /intelligent-set/logs/batch
// data: { ids: [] }
export function batchDeleteOperationLogs(data) {
  return http.delete('/intelligent-set/logs/batch', { data })
}

// Export operation logs: GET /intelligent-set/logs/export
// params: { current, size, keyword, format, ids }
export function exportOperationLogs(params) {
  return http.get('/intelligent-set/logs/export', {
    params,
    responseType: 'blob' // for file download
  })
}

// Get operation log detail: GET /intelligent-set/logs/{id}
export function getOperationLogDetail(id) {
  return http.get(`/intelligent-set/logs/${id}`)
}